from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^usernames/([a-zA-Z0-9_-]{5,20})/count/$', views.CheckUsernameView.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    url(r'^login/$', views.LoginView.as_view()),
    url(r'^logout/$', views.LogoutView.as_view()),
    url(r'^info/$', views.UserInfoView.as_view()),  # 用户中心
    url(r'^emails/$', views.EmailSendView.as_view()),  # 邮件发送
    url(r'^emails/verification/$', views.EmailActiveView.as_view()),  # 邮件验证
    url(r'^addresses/$', views.AddressesView.as_view()),  # 收货地址
    url(r'^areas/$', views.AreasView.as_view()),  # 区域信息
    url(r'^addresses/create/$', views.AddressesCreateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.AddressesDefaultView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/$',views.AddressUpdateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/title/$',views.AddressTitleView.as_view()),
    url(r'^password/$',views.PasswordChangeView.as_view()),
    url(r'^password/find/$',views.PasswordFindView.as_view()),
    url(r'^orders/info/(?P<page_num>\d+)/$',views.OrderInfoView.as_view()),
    # 找回密码第三步，修改密码
    url('^users/(?P<user_id>\d+)/password/$', views.ChangePwdView.as_view()),
]

